import userState from '../state/user';

export default function userOp(state = {...userState}, action = {}) {
  const {type, payload} = action;
  switch (type) {
    case 'LOGIN':
      return {
        ...state,
        ...payload,
        isLogin: true,
      };
    case 'Exit':
      return {
        isLogin: false,
      };
    default:
      return state;
  }
}
